home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / tools / usefull / usefull libs / expname / include / inline / expname.h next >
C/C++ Source or Header  |  1996-04-08  |  2KB  |  66 lines

  1. #ifndef _INLINE_EXPNAME_H
  2. #define _INLINE_EXPNAME_H
  3.  
  4. #include <sys/cdefs.h>
  5. #include <inline/stubs.h>
  6.  
  7. __BEGIN_DECLS
  8.  
  9. #ifndef BASE_EXT_DECL
  10. #define BASE_EXT_DECL
  11. #define BASE_EXT_DECL0 extern struct Library * ExpnameBase;
  12. #endif
  13. #ifndef BASE_PAR_DECL
  14. #define BASE_PAR_DECL
  15. #define BASE_PAR_DECL0 void
  16. #endif
  17. #ifndef BASE_NAME
  18. #define BASE_NAME ExpnameBase
  19. #endif
  20.  
  21. BASE_EXT_DECL0
  22.  
  23. static __inline ULONG
  24. GetExpName (BASE_PAR_DECL STRPTR manufname,STRPTR prodname,struct ConfigDev *configdev,UWORD manufacturer,UBYTE product)
  25. {
  26.   BASE_EXT_DECL
  27.   register ULONG _res __asm("d0");
  28.   register struct Library *a6 __asm("a6") = BASE_NAME;
  29.   register STRPTR a0 __asm("a0") = manufname;
  30.   register STRPTR a1 __asm("a1") = prodname;
  31.   register struct ConfigDev *a2 __asm("a2") = configdev;
  32.   register UWORD d0 __asm("d0") = manufacturer;
  33.   register UBYTE d1 __asm("d1") = product;
  34.   __asm __volatile ("jsr a6@(-30)"
  35.   : "=r" (_res)
  36.   : "r" (a6), "r" (a0), "r" (a1), "r" (a2), "r" (d0), "r" (d1)
  37.   : "a0","a1","a2","d0","d1", "memory");
  38.   return _res;
  39. }
  40.  
  41. static __inline STRPTR
  42. GetSysInfo (BASE_PAR_DECL STRPTR buffer,ULONG type,ULONG reserved)
  43. {
  44.   BASE_EXT_DECL
  45.   register STRPTR _res __asm("d0");
  46.   register struct Library *a6 __asm("a6") = BASE_NAME;
  47.   register STRPTR a0 __asm("a0") = buffer;
  48.   register ULONG d0 __asm("d0") = type;
  49.   register ULONG d1 __asm("d1") = reserved;
  50.   __asm __volatile ("jsr a6@(-36)"
  51.   : "=r" (_res)
  52.   : "r" (a6), "r" (a0), "r" (d0), "r" (d1)
  53.   : "a0","a1","d0","d1", "memory");
  54.   return _res;
  55. }
  56.  
  57. #undef BASE_EXT_DECL
  58. #undef BASE_EXT_DECL0
  59. #undef BASE_PAR_DECL
  60. #undef BASE_PAR_DECL0
  61. #undef BASE_NAME
  62.  
  63. __END_DECLS
  64.  
  65. #endif /* _INLINE_EXPNAME_H */
  66.